import request from '@/utils/request'

// 查询存储库存信息的列表
export function listStock(query) {
  console.log(query)
  return request({
    url: '/stock/stock/list',
    method: 'get',
    params: query
  })
}

// 查询存储库存信息的详细
export function getStock(id) {
  return request({
    url: '/stock/stock/' + id,
    method: 'get'
  })
}

// 新增存储库存信息的
export function addStock(data) {
  return request({
    url: '/stock/stock',
    method: 'post',
    data: data
  })
}

// 修改存储库存信息的
export function updateStock(data) {
  return request({
    url: '/stock/stock',
    method: 'put',
    data: data
  })
}

// 删除存储库存信息的
export function delStock(id) {
  return request({
    url: '/stock/stock/' + id,
    method: 'delete'
  })
}

//根据id查询商品库存信息
export function getStockByProId(pid) {
  return request({
    url: '/stock/stock/selectStockByProductId/' + pid,
    method: 'get'
  })
}
